//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.details;

import java.io.Serializable;

public class Details
        implements Serializable {

    public Details() {
    }

    public Details(Integer id, Integer detailListId, String value, String notes, Object parentId, byte image[], String updateUserId,
            String updateTime) {
        setId(id);
        setDetailListId(detailListId);
        setValue(value);
        setNotes(notes);
        setParentId(parentId);
        setImage(image);
        setUpdateUserId(updateUserId);
        setUpdateTime(updateTime);
    }

    public Details(Details otherData) {
        setId(otherData.getId());
        setDetailListId(otherData.getDetailListId());
        setValue(otherData.getValue());
        setNotes(otherData.getNotes());
        setParentId(otherData.getParentId());
        setImage(otherData.getImage());
        setUpdateUserId(otherData.getUpdateUserId());
        setUpdateTime(otherData.getUpdateTime());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setDetailListId(Integer detailListId) {
        this.detailListId = detailListId;
    }

    public Integer getDetailListId() {
        return detailListId;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte image[]) {
        this.image = image;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Object getParentId() {
        return parentId;
    }

    public void setParentId(Object parentId) {
        this.parentId = parentId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "detailListId=" + getDetailListId() + " " + "value=" + getValue() + " " + "notes=" + getNotes() + " " + "parentId=" + getParentId() + " " + "image=" + getImage() + " " + "updateUserId=" + getUpdateUserId() + " " + "updateTime=" + getUpdateTime());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Details) {
            Details lTest = (Details) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (detailListId == null) {
                lEquals = lEquals && lTest.detailListId == null;
            } else {
                lEquals = lEquals && detailListId.equals(lTest.detailListId);
            }
            if (value == null) {
                lEquals = lEquals && lTest.value == null;
            } else {
                lEquals = lEquals && value.equals(lTest.value);
            }
            if (updateUserId == null) {
                lEquals = lEquals && lTest.updateUserId == null;
            } else {
                lEquals = lEquals && updateUserId.equals(lTest.updateUserId);
            }
            if (updateTime == null) {
                lEquals = lEquals && lTest.updateTime == null;
            } else {
                lEquals = lEquals && updateTime.equals(lTest.updateTime);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (parentId == null) {
                lEquals = lEquals && lTest.parentId == null;
            } else {
                lEquals = lEquals && parentId.equals(lTest.parentId);
            }
            if (image == null) {
                lEquals = lEquals && lTest.image == null;
            } else {
                lEquals = lEquals && image.equals(lTest.image);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (detailListId == null ? 0 : detailListId.hashCode());
        result = 37 * result + (value == null ? 0 : value.hashCode());
        result = 37 * result + (updateUserId == null ? 0 : updateUserId.hashCode());
        result = 37 * result + (updateTime == null ? 0 : updateTime.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (parentId == null ? 0 : parentId.hashCode());
        result = 37 * result + (image == null ? 0 : image.hashCode());
        return result;
    }
    private Integer id;
    private Integer detailListId;
    private String value;
    private String notes;
    private Object parentId;
    private byte image[];
    private String updateUserId;
    private String updateTime;
}
